﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Backend/Backend.Master" Inherits="System.Web.Mvc.ViewPage<IntroduceCompany.AlbumView>" %>
<%@Register Assembly="CKEditor.NET" Namespace="CKEditor.NET" TagPrefix="CKEditor"%>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	AlbumEdit
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<script type="text/javascript" src="<%= Url.Content("../../../Content/Backend/js/ckeditor/ckeditor.js")%>"></script>
<!-- Begin one column tab content window -->
    <div class="onecolumn">
        <div class="header">
            <span>Thêm Ngôn Ngữ Hoặc Chỉnh Sửa Album</span>
            <div class="switchbutton">
            <% if (Model.AlbumVisible)
                {%>
                <a href="<%= Url.Action("Frontend_AlbumDetails2", "Album", new  { albumID = Model.AlbumID, languageID = Model.LanguageID })%>"
                target="_blank" class="button">Xem nhanh</a>
              <%} %>
                <%= Html.ActionLink("Thêm hình vào album", "AlbumDetail", "Album", new { albumID = Model.AlbumID, languageID = Model.LanguageID }, new { @class = "button" })%>
                <%= Html.ActionLink("Thêm mới", "AlbumCreate", "Album", null, new { @class = "button" })%>
                <%= Html.ActionLink("Danh sách", "AlbumList", "Album",null, new { @class = "button" })%>
            </div>
        </div>
        <br class="clear" />
        <div class="content">
           
            <div class="display-label error">
                <div class="errorcontent">
                    <%= Html.ValidationMessage("Notice")%>
                    <p><%= Html.ValidationMessageFor(model => model.AlbumTitle)%></p>
                </div>
            </div>
                    
            <img src="../../../Image/Album/album-<%= Model.AlbumID%>/<%= Model.AlbumPhoto %>" alt="<%= Model.AlbumPhoto %>" class="img_h170"/>



            <% using (Html.BeginForm("Edit", "Album")){%>
            <div>
                <div class="editor_left">
                    <label>Ngôn ngữ:</label><br />
                    <%= Html.DropDownList("languageID", (SelectList)ViewData["LaguageList"], new { @style = "width:300px", onchange = "this.form.submit();" })%>
                    <%= Html.HiddenFor(model => model.AlbumID)%>
                </div>
            </div><br class="clear"/><br />
            <%} %>



            <% using (Html.BeginForm("AlbumEdit", "Album", FormMethod.Post, new { enctype = "multipart/form-data" })){%>
            <%= Html.AntiForgeryToken(IntroduceCompany.Util.AntiKey.EditSalt)%>
            <div>
                <div class="editor_left">
                    <label>Mã số album:</label><br />
                    <%= Html.TextBoxFor(model => model.AlbumID, new { @readonly = "readonly" })%>
                </div>
                <div class="editor_middle">
                    <label>Ảnh đại diện:</label><br />
                    <input name="uploadFile" id="uploadFile" type="file" />
                </div>
            </div><br class="clear"/><br />
            <div>
                <div class="editor_left">
                    <label>Ngày chỉnh sửa cuối:</label>
                    <%= IntroduceCompany.Util.GeneralClass.ConvertDate_1B(Model.AlbumDate)%>
                </div>
                <div class="editor_middle">
                    <label>Người chỉnh sửa cuối:</label>
                    <%= Model.FullName%>
                </div>
            </div>
            <br class="clear"/><br />
            <div>
                <label>Tên album</label><br />
                <%= Html.TextBoxFor(model => model.AlbumTitle, new { @style = "width:620px;", maxlength = "120" })%>
            </div><br class="clear"/><br />
            
            <div>
                <label>Mô tả album:</label><br />
                <%= Html.TextAreaFor(model => model.AlbumDescription, new { @class = "ckeditor" })%>
            </div>
            <br class="clear"/>
            
            <%= Html.HiddenFor(model => model.AlbumPhoto) %>
            <%= Html.HiddenFor(model => model.LanguageID) %>
            <p>
                <input type="submit" value="Lưu" />
                <a href="<%= Url.Action("Edit","Album", new { albumID = Model.AlbumID, languageID = Model.LanguageID }) %>"  class="buttonform">Làm Lại</a>
            </p>

            <script type="text/javascript">
                CKEDITOR.replace('AlbumDescription', {
                    BasePath: '../../../Content/Backend/js/ckeditor/',
                    customConfig: 'CustomAdmin.js'
                });
	        </script>
            <% } %>
        </div>
    </div>
</asp:Content>

